﻿

using System;
using System.Collections;
using DataAccess;
using Model;

namespace Service
{
    public class ReferenceDataServicePermission : ServiceBase
    {

        ReferenceDataAccess mgr;
        public ReferenceDataServicePermission()
        {
            mgr = new ReferenceDataAccess();
        }
        public int GetPermissionId(string  permissionLabel)
        {

            IList result= mgr.GetListByPropertyValueAndOrder(typeof(Permissions), Permissions.CONST_PERMISSION_LABEL, permissionLabel,
                                                   Permissions.CONST_PERMISSION_LABEL);
            if (result.Count != 0)
                return Int32.Parse(((Permissions) (result[0])).PermissionId.ToString());
            return -1;
        
        }

    }
}
